package DTO;

import java.io.Serializable;

public class RecordDTO implements Serializable {
	private int _nCol;
	private String[] _data;

	public RecordDTO() {
		_nCol = 0;
		_data = new String[0];
	}
	
	public RecordDTO(int nCol, String[] data){
		_nCol = nCol;
		_data = data;
	}

	public RecordDTO(RecordDTO record) {
		_nCol = record._nCol;
		_data = record._data.clone();
	}

	public void set_nCol(int _nCol) {
		this._nCol = _nCol;
	}

	public int get_nCol() {
		return _nCol;
	}

	public void set_data(String[] _data) {
		this._data = _data;
	}

	public String[] get_data() {
		return _data;
	}

	public String get_data(int colIndex)
	{
		return _data[colIndex];
	}
	public RecordDTO mul(RecordDTO record) {
		// TODO Auto-generated method stub
		RecordDTO result = null;
		int nCol = this._nCol + record._nCol;
		String[] data = new String[nCol];
		int idx = 0;
		for (int i = 0; i < this._data.length; i++) {
			data[i] = this._data[i];
			idx++;
		}
		for (int j = 0; j < record._data.length; j++) {
			data[idx] = record._data[j];
			idx++;
		}
		result = new RecordDTO(nCol, data);
		return result;
	}
}
